import '../entities/anime.dart';

/// 动漫数据仓库接口
/// 定义业务层所需的数据操作
abstract class AnimeRepository {
  /// 获取热门动漫列表
  Future<List<Anime>> getTopAnime({
    int page = 1,
    String filter = 'bypopularity',
    int limit = 25,
  });

  /// 获取即将上线的动漫 (用于轮播图)
  Future<List<Anime>> getUpcomingAnime({
    int page = 1,
    int limit = 5,
    bool forceRefresh = false,
  });

  /// 获取最新最火的动漫 (用于推荐)
  Future<List<Anime>> getTrendingAnime({
    int page = 1,
    int limit = 20,
    bool forceRefresh = false,
  });

  /// 搜索动漫
  Future<List<Anime>> searchAnime({
    required String query,
    int page = 1,
    String? type,
    String? status,
    String? genre,
  });

  /// 获取动漫详情
  Future<Anime> getAnimeDetails(int animeId);

  /// 获取动漫推荐
  Future<List<Anime>> getAnimeRecommendations(int animeId);

  /// 获取当季动漫
  Future<List<Anime>> getSeasonalAnime({
    int? year,
    String season = 'now',
    int page = 1,
    bool forceRefresh = false,
  });

  /// 根据分类获取动漫
  Future<List<Anime>> getAnimeByGenre({
    required int genreId,
    int page = 1,
    int limit = 20,
  });

  /// 根据状态获取动漫
  Future<List<Anime>> getAnimeByStatus({
    required String status,
    int page = 1,
    int limit = 20,
  });

  /// 根据类型获取动漫
  Future<List<Anime>> getAnimeByType({
    required String type,
    int page = 1,
    int limit = 20,
  });

  /// 获取最新集数
  Future<List<Anime>> getRecentEpisodes({
    int limit = 15,
    bool forceRefresh = false,
  });

  /// 清除缓存
  Future<void> clearCache();

  /// 获取缓存状态
  Future<Map<String, dynamic>> getCacheStatus();
} 